import request from '@/utils/request'

// 查询停车位列表
export function listSpace(query) {
  return request({
    url: '/parking/space/list',
    method: 'get',
    params: query
  })
}

// 查询停车位详细
export function getSpace(scSpaceId) {
  return request({
    url: '/parking/space/' + scSpaceId,
    method: 'get'
  })
}

// 新增停车位
export function addSpace(data) {
  return request({
    url: '/parking/space',
    method: 'post',
    data: data
  })
}

// 修改停车位
export function updateSpace(data) {
  return request({
    url: '/parking/space',
    method: 'put',
    data: data
  })
}

// 删除停车位
export function delSpace(scSpaceId) {
  return request({
    url: '/parking/space/' + scSpaceId,
    method: 'delete'
  })
}

// 查询指定停车区的全部停车位
export function listSpaceByArea(query) {
  return request({
    url: '/parking/space/listByArea',
    method: 'get',
    params: query
  })
}

// 通过车牌号查对应车位
export function querySpaceByCar(query) {
  return request({
    url: '/parking/space/querySpaceByCar',
    method: 'get',
    params: query
  })
}